<%@tag pageEncoding="UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<%@ taglib prefix="custom" tagdir="/WEB-INF/tags" %>
<%@attribute name="list" required="true" type="java.util.List" %>
<%@attribute name="index" required="true" type="java.lang.Integer" %>
<%@attribute name="name" required="false" type="java.lang.String" %>

<c:if test="${index eq 0}">
    <select name="${name}" class="form-control">
    <option value="" selected="selected">请选择部门</option>
</c:if>
<c:forEach items="${list}" var="item" varStatus="status">
    <option value="${item.uuid}" ${formDto.deptUuid eq item.uuid ? "selected='selected'":""} >
        <c:forEach begin="1" end="${index}">--</c:forEach>${item.name}
    </option>
    <custom:dept_tree_list list="${item.childDept}" index="${index+1}"/>
</c:forEach>
<c:if test="${index eq 0}">
    </select>
</c:if>

